﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using LibNiconico.NiconicoApi.Internal;
using LibNiconico.NiconicoApi.Extentions;


namespace LibNiconico.NiconicoApi.Videos.Comments.PostKey
{
    /// <summary>
    /// ニコニコ動画ポストキー取得問い合わせ情報
    /// </summary>
    internal sealed class NicoVideoGetPostKeyQuery:NicoUrlAble
    {
        /// <summary>
        /// スレッド番号
        /// </summary>
        internal string Thread { get; set; }
        
        /// <summary>
        /// ブロック番号
        /// </summary>
        internal string BlockNo { get; set; }
        
        /// <summary>
        /// 不明
        /// </summary>
        internal string Yugi { get; set; }

        /// <summary>
        /// URLパスとして取得
        /// </summary>
        /// <returns></returns>
        internal override string AsPath()
        {
            return "api/getpostkey";
        }

        internal NicoVideoGetPostKeyQuery(string thread, string blockNo):this(thread,blockNo,"")
        {

        }

        internal NicoVideoGetPostKeyQuery(string thread, string blockNo, string yugi)
        {
            this.Thread = thread;
            this.BlockNo = blockNo;
            this.Yugi = yugi;
        }

        /// <summary>
        /// URL問い合わせ文字列として取得
        /// </summary>
        /// <returns></returns>
        internal override string AsQuery()
        {
            QueryStrings querys = new QueryStrings();
            querys.Add("thread", this.Thread);
            querys.Add("block_no", this.BlockNo);
            querys.Add("yugi", this.Yugi);
            return querys.ToString();
        }
    }
}
